In a data processing apparatus it is useful to provide mechanisms for performing diagnostic operations which may be used, for example, during the development of the data processing system. One mechanism which may be provided is to arrange a trigger point which causes a diagnostic operation to be performed when a predetermined event is detected. For example, a breakpoint may be set up so that a diagnostic operation is triggered when a program instruction is fetched from a predetermined address in memory. Alternatively, or additionally, a watchpoint may be set up to trigger a diagnostic operation when a program instruction accesses a predetermined address in memory.
In a data processing apparatus, sequences of program instructions which are executed by a processor are typically stored in a memory. In some systems the processor is able to operate in a number of states known as contexts, each context comprising a sequence of program instructions executed in turn. An example of such systems are the processors produced by ARM Limited of Cambridge, in which the context is identified by a context identifier, eight bits of which are used as an application space identifier (ASID) tag to identify one of up to 256 processes. In a system using virtual addressing, the different contexts will share the virtual address space and the ASID provides a way of differentiating between data at the same virtual address within different contexts.
It is known to provide context-aware trigger points, which trigger performing a diagnostic operation in a manner responsive to the context identifier of the current context of the processor. These context-aware trigger points may be linked to the address-aware trigger points described above, so that a diagnostic operation is only triggered if a predetermined address is accessed and a predetermined context matches the current state of the system.
A processor may be programmed to act as a virtual machine so that it replicates the features of itself or of another machine.